home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
UTILITY
/
TASEXAM6.ARJ
/
CCIOPT.TAS
< prev
next >
Wrap
Text File
|
1992-02-09
|
1KB
|
35 lines
{ CCIOPT.TAS
Script that shows how to do Profit Test for multiple periods of
an indicator to see which one generates the best profits.
You should run this script as follows:
TAS CCIOPT ticker @Speriod=s; Eperiod=e;
where "ticker" is the ticker list to run (make it a small one!)
"s" is the starting period for the CCI optimization test
"e" is the ending period for the CCI optimization test
}
#MAX_QUOTES 1000
#PROFIT_TEST BOTH 1000 Y
#PROFIT_COMM NOCOMM ALLCASH 0 - TODAYS CLOSE
#PROFIT_OUTPUT TICKERSUMMARY
#OUTPUT_FILE 'CCIOPT.LST+'
{
Check if the Start period and End period were specified when
the script began. If not, then default to 1 to 500.
}
If Speriod = 0 then
Speriod = 1; { Start at 1 day period}
if Eperiod = 0 then
Eperiod = 500; { go to 500 day period }
F1 : ARRAY;
PLOT BEGIN
Period = REDO_COUNT()+Speriod;
writeln('CCI Period IS ',INT(Period));
F1 = CCI(Period);
IF Period < Eperiod THEN
REDO();
END; { of PLOT BEGIN}
C1 = (F1[-1] < -100 AND F1[0] > -100);
C2 = (F1[-1] > 100 AND F1[0] < 100);
BUY WHEN (C1);
SELL WHEN (C2);